﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Backup.Services.Entities;

namespace Backup.Services.Logic
{
    /// <summary>
    /// The service logic for Tag Service
    /// </summary>
    public interface ITagServiceLogic
    {
        /// <summary>
        /// Save the given tag.
        /// </summary>
        /// <param name="tagEntity">The tag to save.</param>
        /// <returns>The saved tag( with new id when the original id was default value).</returns>
        TagEntity Save(TagEntity tagEntity);

        /// <summary>
        /// Delete the given tag.
        /// </summary>
        /// <param name="id">The tag id to delete.</param>
        /// <remarks>Only the Id need to be set to the tag entity.</remarks>
        void Delete(Guid id);

        /// <summary>
        /// Load a tag based on the id.
        /// </summary>
        /// <param name="id">The id of the tag.</param>
        /// <returns>The tag with the given id.</returns>
        TagEntity Load(Guid id);

        /// <summary>
        /// Load all tags from repository.
        /// </summary>
        /// <returns></returns>
        List<TagEntity> LoadAll();

        /// <summary>
        /// Load a list of specific tags based on ids.
        /// </summary>
        /// <param name="ids">The list of ids</param>
        /// <returns>The list of tags with the given ids</returns>
        List<TagEntity> LoadAllByIds(List<Guid> ids);

        /// <summary>
        /// Get all the childrens of the given tag.
        /// </summary>
        /// <param name="tag"></param>
        /// <returns></returns>
        List<TagEntity> GetChildrens(TagEntity tag);

        /// <summary>
        /// Get the parent of the given tag.
        /// </summary>
        /// <returns>The parent tag of the given tag</returns>
        TagEntity GetParent(TagEntity tag);     
    }
}
